﻿using System.Net.Mail;
using PCC.Notification;

namespace PCC.AWS
{
    public class MessageFactory
    {
        public static void Send(INotificationContext context)
        {
            MailMessage mailMessage = new MailMessage();
            SmtpClient smtpclient = new SmtpClient(context.NotificationSystem.SmtpHost, context.NotificationSystem.SmtpPort);
            mailMessage.To.Add(new MailAddress(context.NotificationSystem.SmtpFromEMail));
            mailMessage.Subject = BuildSubject(context);
            mailMessage.Body = BuildBody(context);
            mailMessage.Priority = MailPriority.Normal;

            smtpclient.Send(mailMessage);
        }

        private static string BuildBody(INotificationContext context)
        {
            throw new System.NotImplementedException();
        }

        private static string BuildSubject(INotificationContext context)
        {
            return context.Notification.Subject;
        }
    }
}